#include "mainwindow.h"
#include <QApplication>
#include <QStyleFactory>
#include <QSettings>
#include "./src/public_opt_subs/windows_mdle/window_blck/setWindows.h"
#include "./src/public_opt_subs/windows_mdle/ubuntu_blck/setLinux.h"
#include <QStyleFactory>
#include "./src/MACRO.h"
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    // =====================================================
    // theme set
    QString setting_ini = QApplication::applicationDirPath() + "/user_data/setting.ini";
    QSettings * settings = new QSettings(setting_ini,QSettings::IniFormat);
    QString theme = settings->value("main_theme","dark").toString();
    delete settings;
    if(theme == "dark")
    {
        //set dark
        qApp->setStyle(QStyleFactory::create("Fusion"));
        QPalette palette;
        palette.setColor(QPalette::Window, QColor(53, 53, 53));
        palette.setColor(QPalette::WindowText, Qt::white);
        palette.setColor(QPalette::Base, QColor(15, 15, 15));
        palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
        palette.setColor(QPalette::ToolTipBase, Qt::white);
        palette.setColor(QPalette::ToolTipText, Qt::white);
        palette.setColor(QPalette::Text, Qt::white);
        palette.setColor(QPalette::Button, QColor(53, 53, 53));
        palette.setColor(QPalette::ButtonText, Qt::white);
        palette.setColor(QPalette::BrightText, Qt::red);
        //palette.setColor(QPalette::Highlight, QColor(142, 45, 197).lighter()); //紫色
        palette.setColor(QPalette::Highlight, QColor(161, 65, 13).lighter());//橙色
        palette.setColor(QPalette::HighlightedText, Qt::black);
        //palette.setColor(QPalette::Background,Qt::cyan);
        qApp->setPalette(palette);

        // 根据当前操作系统进行特殊设置

    }

    qRegisterMetaType<itf_pkg>("itf_pkg");
    qRegisterMetaType<itf_fil>("itf_fil");

    return a.exec();
}
